package 归并排序算法;

public class sortArray912 {
    /**
     * 归并排序的算法
     * <p>
     * // 拆分
     * <p>
     * // 数组合并
     *
     * @param nums
     * @return
     */
    public int[] sortArray(int[] nums) {
        if (nums.length == 0) {
            return nums;
        }
        split_array(nums, 0, nums.length - 1);
        return nums;
    }

    private void split_array(int[] nums, int left, int right) {
        if (left > right) {
            return;
        }
        int mid = (left + right) >> 1;
        split_array(nums, left, mid);
        split_array(nums, mid + 1, right);
        merge(nums, left, mid, right);
    }

    //合并数组
    private void merge(int[] nums, int left, int mid, int right) {

    }
}
